$(document).ready(function(){
	$("#btnAction #allSelect").click(function(){
		if($('.tableNameCheckBox').attr("checked")){
			$('#allSelectAction').val("no");
			$('.tableNameCheckBox').attr("checked",false);
		}else{
			$('#allSelectAction').val("yes");
			$('.tableNameCheckBox').attr("checked",true);
		}
	});
	$(".tableName span").click(function(){
		refreshOlineUser($(this).html());
		var parent = $(this).parent(".tableName");
		if(parent.children(".tableNameCheckBox").attr("checked")){
			parent.children(".tableNameCheckBox").attr("checked",false);
		}else{
			parent.children(".tableNameCheckBox").attr("checked",true);
		}
	});
});

function refreshOlineUser(value){
	$.ajax({
		url: 'showTableDate.php',
		type: 'POST',
		data: {tableName:value},
		dataType: 'html',
		cache: false,
		global: false,
		beforeSend: function(){
		},
		success: function(data){
			$("#tableDateList").html(data);
		},
		error:function(XMLHttpRequest, textStatus, errorThrown){
		},
		complete:function(){
		}
	});
}